<template>
    <div class="config-item-box">
        <div class="item-left">
            {{ name }}
            <slot name="name"></slot>
        </div>
        <div 
            class="item-right"
            :style="{
                gridTemplateColumns: alone ? '1fr' : '1fr 1fr',
            }"    
        >
            <slot />
        </div>
    </div>
</template>

<script setup lang="ts">


withDefaults(defineProps<{
    name?: string,
    alone?: boolean
}>(), {})
</script>

<style lang='scss' scoped>
$leftWidth: 60px;
.config-item-box {
    position: relative;
    display: flex;
    margin-bottom: 20px;

    .item-left {
        width: $leftWidth;
        text-align: left;
        margin-top: 4px;
        margin-left: 10px;
        font-size: 12px;
    }

    .item-right {
        display: grid;
        grid-column-gap: 10px;
        width: calc(100% - #{$leftWidth});
    }
}
</style>